home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / nt / 82595.exe / OEMSETUP.INF < prev   
INI File  |  1993-09-30  |  45KB  |  1,565 lines

  1. ;***********************************************************************
  2. ;
  3. ; OEMSETUP.INF
  4. ;
  5. ;       Intel 82595 Ethernet LAN controller card and driver SETUP INF file.
  6. ;
  7. ;***********************************************************************
  8.  
  9. ;-----------------------------------------------------------------------
  10. ; OPTION TYPE
  11. ; -----------
  12. ; This identifies the Option type we are dealing with.  The different
  13. ; possible types are:
  14. ;
  15. ; COMPUTER, DISPLAY, MOUSE, KEYBOARD, LAYOUT, SCSI, PRINTER, ...
  16. ;
  17. ;  Types specific to networking:
  18. ;
  19. ; NetAdapter,        a netcard / adapter combination or just a netcard
  20. ; NetDriver,         just a netcard driver
  21. ; NetTransport,      a complete NDIS-compliant TDI transport stack
  22. ; NetService,        an NT networking service
  23. ; NetWork,           a complete network ensemble.
  24. ; NetProvider        a complete network which supports NT MPR protocol
  25. ;-----------------------------------------------------------------------
  26.  
  27. [Identification]
  28.     OptionType = NetAdapter
  29.  
  30. ;-----------------------------------------------------------------------
  31. ; PlatformsSupported
  32. ; ------------------
  33. ; This identifies the platforms supported by the adapter card.
  34. ; Possible types are:
  35. ;
  36. ; ISA, EISA and MCA
  37. ;-----------------------------------------------------------------------
  38.  
  39. [PlatformsSupported]
  40.     ISA
  41.     EISA
  42. ;    MCA
  43.     "Jazz-Internal Bus"
  44.  
  45. ;-----------------------------------------------------------------------
  46. ; LANGUAGES SUPPORTED
  47. ; -------------------
  48. ;
  49. ; The languages supported by the OEM INF, For every language supported
  50. ; we need to have a separate text section for every displayable text
  51. ; section.
  52. ;
  53. ;-----------------------------------------------------------------------
  54.  
  55. [LanguagesSupported]
  56.     ENG
  57.  
  58. ;-----------------------------------------------------------------------
  59. ; OPTION LIST
  60. ; -----------
  61. ; This section lists the OEM Option key names.  These keys are locale
  62. ; independent and used to represent the option in a locale independent
  63. ; manner.
  64. ;
  65. ;-----------------------------------------------------------------------
  66.  
  67. [Options]
  68.     I82595
  69.  
  70. ;-----------------------------------------------------------------------
  71. ; OPTION TEXT SECTION
  72. ; -------------------
  73. ; These are text strings used to identify the option to the user.  There
  74. ; are separate sections for each language supported.  The format of the
  75. ; section name is "OptionsText" concatenated with the Language represented
  76. ; by the section.
  77. ;
  78. ;-----------------------------------------------------------------------
  79.  
  80. [OptionsTextENG]
  81.     I82595 = "Intel 82595 Ethernet LAN Controller"
  82.  
  83.  
  84. [Files-Inf]
  85. 1, oemsetup.inf, SIZE=50000, RENAME=$(!UG_Filename)
  86.  
  87.  
  88. [Files-I82595]
  89. 1, I82595.SYS, SIZE=50000
  90.  
  91. ;***********************************************************************
  92. ; CONSTANTS FOR USING DIALOGS
  93. ;***********************************************************************
  94.  
  95. [FileConstants]
  96. ;
  97. ;  File names, etc.
  98. ;
  99. UtilityInf      = "UTILITY.INF"
  100. ParamInf        = "NCPARAM.INF"
  101. subroutineinf   = "SUBROUTN.INF"
  102. SoftwareType    = "driver"
  103. Exit_Code       = 0
  104.  
  105. ;
  106. ; EventLog Message File
  107. ;
  108. NetEventDLL     = "%SystemRoot%\System32\netevent.dll"
  109. IoLogMsgDLL     = "%SystemRoot%\System32\IoLogMsg.dll"
  110.  
  111. ; Product Info
  112. ;
  113. Manufacturer    =  "Intel"
  114. ProductMajorVersion     = "1"
  115. ProductMinorVersion     = "0"
  116. ProductVersion  = $(ProductMajorVersion)"."$(ProductMinorVersion)
  117. ;
  118. ; Software
  119. ;
  120. ProductSoftwareName     = "I82595"
  121. ProductSoftwareTitle    = "Intel 82595 Ethernet LAN Controller Driver"
  122. ProductSoftwareImagePath = "\SystemRoot\System32\drivers\i82595.sys"
  123. NetRuleSoftwareType     = "i82595Sys ndisDriver i82595Driver"
  124. NetRuleSoftwareUse      = $(SoftwareType)
  125. NetRuleSoftwareBindForm = """I82595Sys"" yes no container"
  126. NetRuleSoftwareClass    = {"i82595Driver basic"}
  127. NetRuleSoftwareBindable = {"i82595Driver i82595Adapter non exclusive 100"}
  128. ;
  129. ; Hardware
  130. ;
  131. ProductHardwareName     = "I82595"
  132. ProductHardwareTitle    = "Intel 82595 Ethernet LAN Controller"
  133. NetRuleHardwareType     = "i82595 i82595Adapter"
  134. NetRuleHardwareBindForm = " yes yes container"
  135. NetRuleHardwareClass    = {"i82595Adapter basic"}
  136. ;
  137. ;  MicroChannel System ID Info
  138. ;
  139. EE16_1BYTE      = 139
  140. EE16_2BYTE      = 98
  141. NETCARD_ID      = 25227
  142. ;
  143. ; Registry Key
  144. ;
  145. ProductKeyName  = $(!NTN_SoftwareBase)"\"$(Manufacturer)"\"$(ProductSoftwareName)"\CurrentVersion"
  146. ParamKeyName    = $(!NTN_ServiceBase)"\"$(ProductHardwareName)"\Parameters"
  147.  
  148. [ProductType]
  149. STF_PRODUCT  = Winnt
  150. STF_PLATFORM = I386
  151.  
  152. [GeneralConstants]
  153. ;
  154. ;  Program flow control variables.
  155. ;
  156. from      = ""
  157. to        = ""
  158. ;
  159. ;  Return codes; Exit_Code is set to one of these
  160. ;
  161. ExitCodeOk     = 0
  162. ExitCodeCancel = 1
  163. ExitCodeFatal  = 2
  164.  
  165. KeyNull         = ""
  166. MAXIMUM_ALLOWED   = 33554432
  167. RegistryErrorIndex = NO_ERROR
  168. KeyProduct      = ""
  169. KeyParameters   = ""
  170.  
  171. TRUE            = 1
  172. FALSE           = 0
  173. NoTitle         = 0
  174.  
  175. ExitState   = "Active"
  176. OldVersionExisted = $(FALSE)
  177.  
  178. DriverPath      = $(!STF_NTPATH)\drivers
  179.  
  180. ;MachineType = ""
  181.  
  182. ;***********************************************************************
  183. ; Language-Dependent Dialog Constants
  184. ;***********************************************************************
  185.  
  186. [FileConstantsENG]
  187. ;
  188. ;  Variables to support thermometer gauge and error dialogs
  189. ;
  190. ProCaption   = "Windows NT Setup"
  191. ProCancel    = "Cancel"
  192. ProCancelMsg = "Windows NT Networking is not correctly installed.  "+
  193.            "Are you sure you want to cancel copying files?"
  194.  
  195. ProCancelCap = "Network Setup Message"
  196. ProText1     = "Copying:"
  197. ProText2     = "To:"
  198.  
  199.  
  200. ;
  201. ; Product Info
  202. ;
  203. FunctionTitle = "Intel 82595 Ethernet LAN Controller Setup"
  204. ;
  205. ; Software
  206. ;
  207. ProductSoftwareDescription = "Intel 82595 Ethernet LAN Controller Driver"
  208. ;
  209. ; Hardware
  210. ;
  211. ProductHardwareDescription = "Intel 82595 Ethernet LAN Controller"
  212.  
  213. ;
  214. ; Dialog Message Information
  215. ;
  216. IRQList = {"3", "5", "9", "10", "11"}
  217. IOReadyList = { "Early", "Late", "Never" }
  218. TransceiverList = {"Thick Net (AUI/DIX)","Thin Net (BNC/COAX)","Twisted-Pair (TPE)"}
  219. IOAddrList = ^(IOAddrChoices, 1)
  220. IOAddrValues = ^(IOAddrChoices, 2)
  221.  
  222. [IOAddrChoices]
  223. IOBase_1  = "0x300",768
  224. IOBase_2  = "0x310",784
  225. IOBase_3  = "0x320",800
  226. IOBase_4  = "0x330",816
  227. IOBase_5  = "0x340",832
  228. IOBase_6  = "0x350",848
  229. IOBase_7  = "0x360",864
  230. IOBase_8  = "0x370",880
  231. IOBase_9  = "0x200",512
  232. IOBase_10 = "0x210",528
  233. IOBase_11 = "0x220",544
  234. IOBase_12 = "0x230",560
  235. IOBase_13 = "0x240",576
  236. IOBase_14 = "0x250",592
  237. IOBase_15 = "0x260",608
  238. IOBase_16 = "0x270",624
  239. IOBase_17 = "0x380",896
  240. IOBase_18 = "0x390",912
  241. IOBase_19 = "0x3a0",928
  242. IOBase_20 = "0x3b0",944
  243. IOBase_21 = "0x3c0",960
  244. IOBase_22 = "0x3d0",976
  245. IOBase_23 = "0x3e0",992
  246. IOBase_24 = "0x3f0",1008
  247. IOBase_25 = "0x280",640
  248. IOBase_26 = "0x290",656
  249. IOBase_27 = "0x2a0",672
  250. IOBase_28 = "0x2b0",688
  251. IOBase_29 = "0x2c0",704
  252. IOBase_30 = "0x2d0",720
  253. IOBase_31 = "0x2e0",736
  254. IOBase_32 = "0x2f0",752
  255.  
  256.  
  257. [DialogConstantsENG]
  258. ;
  259. ; Common button names, etc.
  260. ;
  261. Help        = "&Help"
  262. Exit        = "Cancel"
  263. OK          = "OK"
  264. HelpContext = ""
  265. Continue    = "Continue"
  266. Cancel      = "Cancel"
  267.  
  268. [date]
  269.     ; Now is a list which contains { Sec from 1-1-1970, Year, Month, Day, Hour,
  270.     ; Minute, Second }
  271.     Now = {} ? $(!LIBHANDLE) GetSystemDate
  272.  
  273. [Source Media Descriptions]
  274.     1  = "Intel 82595 Driver Disk"  , TAGFILE = disk1
  275.  
  276. ;-----------------------------------------------
  277. ; Input DIALOGS
  278. ;-----------------------------------------------
  279. [FileDependentDlgENG]
  280.  
  281. DlgType = "RadioCombination"
  282. DlgTemplate = "EE_16"
  283. Caption = $(FunctionTitle)
  284.  
  285. DlgText = "Please select values for the following fields:"
  286.  
  287. Combo1Label = "&Interrupt Number:"
  288. Combo2Label = "I/O &Port Address:"
  289. Combo3Label = "I/O &Channel Ready:"
  290. Combo4Label = "&Transceiver Type:"
  291.  
  292. Combo1List = $(IRQList)
  293. Combo1Out  = $(IRQValue)
  294. Combo2List = $(IOAddrList)
  295. Combo2Out  = $(IOAddrValue)
  296. Combo3List = $(IOReadyList)
  297. Combo3Out  = $(IOReadyValue)
  298. Combo4List = $(TransceiverList)
  299. Combo4Out  = $(TransceiverValue)
  300. ComboListItemsIn  = {Combo1List, Combo2List, Combo3List, Combo4List}
  301. ComboListItemsOut = {Combo1Out, Combo2Out, Combo3Out, Combo4Out}
  302.  
  303. EditTextIn = ""
  304. EditTextLim = ""
  305. CBOptionsGreyed = {}
  306. NotifyFields = {NO, NO}
  307.  
  308. HelpContext = $(!IDH_DB_OEMNADIN_INS)
  309.  
  310. ;---------------------------------------------------------------------------
  311. ; 1. Identify
  312. ;
  313. ; DESCRIPTION:   To verify that this INF deals with the same type of options
  314. ;                as we are choosing currently.
  315. ;
  316. ; INPUT:         None
  317. ;
  318. ; OUTPUT:        $($R0): STATUS: STATUS_SUCCESSFUL
  319. ;                $($R1): Option Type (COMPUTER ...)
  320. ;                $($R2): Diskette description
  321. ;---------------------------------------------------------------------------
  322.  
  323. [Identify]
  324.     ;
  325.     ;
  326.     read-syms Identification
  327.  
  328.     set !G:DebugOutputControl = 1
  329.  
  330.     set Status     = STATUS_SUCCESSFUL
  331.     set Identifier = $(OptionType)
  332.     set Media      = #("Source Media Descriptions", 1, 1)
  333.  
  334.     Return $(Status) $(Identifier) $(Media)
  335.  
  336. ;------------------------------------------------------------------------
  337. ; 2. ReturnOptions:
  338. ;
  339. ; DESCRIPTION:   To return the option list supported by this INF and the
  340. ;                localised text list representing the options.
  341. ;
  342. ;
  343. ; INPUT:         $($0):  Language used. ( ENG | FRN | ... )
  344. ;
  345. ; OUTPUT:        $($R0): STATUS: STATUS_SUCCESSFUL |
  346. ;                                STATUS_NOLANGUAGE
  347. ;                                STATUS_FAILED
  348. ;                                STATUS_NOTSUPPORTED
  349. ;
  350. ;                $($R1): Option List
  351. ;                $($R2): Option Text List
  352. ;------------------------------------------------------------------------
  353.  
  354. [ReturnOptions]
  355.     ;
  356.     ;
  357.     set Status        = STATUS_FAILED
  358.     set OptionList     = {}
  359.     set OptionTextList = {}
  360.  
  361.     ;
  362.     ; Check if the language requested is supported
  363.     ;
  364.     set LanguageList = ^(LanguagesSupported, 1)
  365.     Ifcontains(i) $($0) in $(LanguageList)
  366.     ;
  367.     ; Check if the platforms requested is supported
  368.     ;
  369.     ifstr(i) $($1) == ""
  370.         goto returnoptions
  371.     endif
  372.  
  373.     set PlatformList = ^(PlatformsSupported, 1)
  374.     Ifcontains(i) $($1) in $(PlatformList)
  375.         goto returnoptions
  376.     else
  377.         set Status = STATUS_NOTSUPPORTED
  378.         goto finish_ReturnOptions
  379.     endif
  380.     else
  381.     set Status = STATUS_NOLANGUAGE
  382.     goto finish_ReturnOptions
  383.     endif
  384.  
  385.     ;
  386.     ; form a list of all the options and another of the text representing
  387.     ;
  388.  
  389. returnoptions = +
  390.     set OptionList     = ^(Options, 1)
  391.     set OptionTextList = ^(OptionsText$($0), 1)
  392.     set Status         = STATUS_SUCCESSFUL
  393.  
  394. finish_ReturnOptions = +
  395.     Return $(Status) $(OptionList) $(OptionTextList)
  396.  
  397. ;------------------------------------------------------------------------
  398. ;
  399. ; InstallOption:
  400. ;
  401. ;      This section is shelled to by main installation processing
  402. ;      or by NCPASHEL.INF during reconfig, removal, update, etc.
  403. ;
  404. ;
  405. ; FUNCTION:  To copy files representing Options
  406. ;            To configure the installed option
  407. ;            To update the registry for the installed option
  408. ;
  409. ; INPUT:     $($0):  Language to use
  410. ;            $($1):  OptionID to install
  411. ;            $($2):  SourceDirectory
  412. ;            $($3):  AddCopy  (YES | NO)
  413. ;            $($4):  DoCopy   (YES | NO)
  414. ;            $($5):  DoConfig (YES | NO)
  415. ;
  416. ; OUTPUT:    $($R0): STATUS: STATUS_SUCCESSFUL |
  417. ;                            STATUS_NOLANGUAGE |
  418. ;                            STATUS_USERCANCEL |
  419. ;                            STATUS_FAILED
  420. ;
  421. ;------------------------------------------------------------------------
  422. [InstallOption]
  423.  
  424.     set !G:DebugOutputControl = 1
  425.     ;
  426.     ; Set default values for
  427.     ;
  428.     Debug-Output "At InstallOption"
  429.     set Status   = STATUS_FAILED
  430.     ;
  431.     ; extract parameters
  432.     ;
  433.     set Option   = $($1)
  434.     set SrcDir   = $($2)
  435.     set AddCopy  = $($3)
  436.     set DoCopy   = $($4)
  437.     set DoConfig = $($5)
  438.  
  439.     ;
  440.     ; Check if the language requested is supported
  441.     ;
  442.     set LanguageList = ^(LanguagesSupported, 1)
  443.     Ifcontains(i) $($0) NOT-IN $(LanguageList)
  444.     Return STATUS_NOLANGUAGE
  445.     endif
  446.  
  447.     set-subst LF = "\n"
  448.  
  449.     read-syms GeneralConstants
  450.     read-syms FileConstants
  451.  
  452.     read-syms DialogConstants$(!STF_LANGUAGE)
  453.     ifstr(i) $(!NTN_Origination) == "NCPA"
  454.     set Continue = "OK"
  455.     endif
  456.     read-syms FileConstants$(!STF_LANGUAGE)
  457.  
  458.     detect date
  459.  
  460.     set-title  $(FunctionTitle)
  461.  
  462.     set to   = Begin
  463.     set from = Begin
  464.  
  465.     Shell $(UtilityInf), GetBusTypeNum
  466.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  467.     Debug-Output "ShellCode error."
  468.     goto ShellCodeError
  469.     endif
  470.     Set PlatformList = ^(PlatformsSupported, 1)
  471.     Set MachineType = *($(PlatformList), $($R1))
  472.     Debug-Output "BusTypeNum is: "$($R1)
  473.     Debug-Output "MachineType is: "$(MachineType)
  474.  
  475. ;
  476. ;  Assume all is well.
  477. ;
  478.     set CommonStatus = STATUS_SUCCESSFUL
  479.  
  480.     EndWait
  481.  
  482. ;
  483. ;   Set up the operation-mode-based variables and gaily welcome
  484. ;   the user.  If the "install mode" variable is improperly set,
  485. ;   assume this is a new installation.
  486. ;
  487.  
  488. Begin = +
  489.     Debug-Output "At Begin"
  490.     Set ActivateDetection = FALSE
  491.  
  492.     Ifstr(i) $(!NTN_InstallMode) == deinstall
  493.     set StartLabel = removeadapter
  494.     else-Ifstr(i) $(!NTN_InstallMode) == Update
  495.     set StartLabel = UpgradeSoftware
  496.     else-Ifstr(i) $(!NTN_InstallMode) == bind
  497.     set StartLabel = bindingadapter
  498.     else-Ifstr(i) $(!NTN_InstallMode) == configure
  499.     set ActivateDetection = TRUE
  500.     set StartLabel = configureadapter
  501.           ;
  502.     ; If MCA we cannot Configure, so just exit out.
  503.     ;       
  504.     ifstr(i) $(MachineType) == "MCA"
  505.         Ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
  506.         Debug-Output "Cannot configure the EtherExpress MCA driver software."
  507.         Shell $(UtilityInf),RegistryErrorString,CANNOT_CONFIGURE_SOFTWARE
  508.         else
  509.         Debug-Output "Cannot configure the EtherExpress MCA adapter card."
  510.         Shell $(UtilityInf),RegistryErrorString,CANNOT_CONFIGURE_HARDWARE
  511.         endif
  512.         set Error = $($R0)
  513.         set from = end
  514.         set to = end
  515.         goto nonfatalinfo
  516.     endif
  517.     ;
  518.     ;   You cannot config the software component
  519.     ;
  520.     Ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
  521.         Debug-Output "Cannot configure the 82595 driver software."
  522.         Shell $(UtilityInf),RegistryErrorString,CANNOT_CONFIGURE_SOFTWARE
  523.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  524.         Debug-Output "ShellCode error: cannot get an error string."
  525.         goto ShellCodeError
  526.         endif
  527.         set Error = $($R0)
  528.         set from = end
  529.         set to = end
  530.         goto nonfatalinfo
  531.     endif
  532.     else
  533.     set ActivateDetection = TRUE
  534.     set StartLabel = installadapter
  535.     set OEM_ABANDON_OPTIONS = {}
  536.     set OEM_ABANDON_SOFTWARE = FALSE
  537.     set OEM_ABANDON_ON = TRUE
  538.     endif
  539.  
  540.     ;===================================================
  541.     ;  Netcard Detection logic
  542.     ;
  543.     ;  Initialize use of netcard detection;
  544.     ;  Construct require global parameter variables
  545.     ;
  546.     Debug-Output "OEMNADIN.INF: =================================================="
  547.     Debug-Output "OEMNADIN.INF: STF_CWDIR is: "$(!STF_CWDIR)
  548.     Debug-Output "OEMNADIN.INF: STF_LANGUAGE is: "$(!STF_LANGUAGE)
  549.     Debug-Output "OEMNADIN.INF: Option is: "$(Option)
  550.     Debug-Output "OEMNADIN.INF: !STF_NCDETECT  is: "$(!STF_NCDETECT)
  551.     Debug-Output "OEMNADIN.INF: !STF_NCOPTION  is: "$(!STF_NCOPTION)
  552.     Debug-Output "OEMNADIN.INF: !STF_NCDETCARD is: "$(!STF_NCDETCARD)
  553.     Debug-Output "OEMNADIN.INF: !STF_NCDETINFO is: "$(!STF_NCDETINFO)
  554.     Debug-Output "OEMNADIN.INF: MachineType is: "$(MachineType)
  555.     Debug-Output "OEMNADIN.INF: =================================================="
  556.  
  557.     Set DetectedCard = FALSE
  558.  
  559.     Ifstr(i) $(ActivateDetection) != TRUE
  560.     Goto $(StartLabel)
  561.     Endif
  562.  
  563.     ifstr(i) $(MachineType) == "MCA"
  564.     goto CheckForMCA
  565.     endif
  566.  
  567.     set IRQValue = *($(IRQList), 1)
  568.     set IOAddrValue = *($(IOAddrList), 1)
  569.     set IOReadyValue = *($(IOReadyList), 2)
  570.     set TransceiverValue = *($(TransceiverList), 3)
  571.  
  572.     Ifstr(i) $(!STF_NCDETECT) == YES
  573.     Ifstr(i) $(!STF_NCOPTION) == $(Option)
  574.        Set DetectedCard = TRUE
  575.        Debug-Output "OEMNADIN.INF: Setting DetectedCard to TRUE"
  576.     Endif
  577.     Endif
  578.     ;
  579.     ;  End Netcard Detection logic
  580.     ;===================================================
  581.  
  582.  
  583.     Shell "" DebugConfiguration "After parameter querying"
  584.  
  585.     Set from = $(fatal)
  586.     Set to = $(fatal)
  587.     Goto $(StartLabel)
  588.  
  589. ;-----------------------------------------------
  590. ; Installation Section
  591. ;-----------------------------------------------
  592.  
  593. installadapter = +
  594.     Debug-Output "At installadapter"
  595. ;
  596. ;   First, check whether the same version of the software exists
  597. ;
  598.     OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
  599.  
  600.     Ifstr $(KeyProduct) != $(KeyNull)
  601.     ;
  602.     ; Same version already existed in the local machine
  603.     ; Popup the dialog and ask the user whether he wants to continue
  604.     ;
  605.     CloseRegKey $(KeyProduct)
  606.  
  607.     ifstr(i) !(NTN_RegBase) == $(ProductKeyName)
  608.        ;
  609.        ; Cannot Install the same software again
  610.        ;
  611.        Shell $(UtilityInf), VerExistedDlg, $(ProductSoftwareTitle),+
  612.            $(ProductVersion)
  613.        ifint $($ShellCode) != $(!SHELL_CODE_OK)
  614.            Debug-Output "ShellCode error: cannot get an error string."
  615.            goto ShellCodeError
  616.        endif
  617.  
  618.        goto end
  619.     else
  620.        ;
  621.        ; Add a new adapter card?
  622.        ;
  623.        Shell $(UtilityInf), CardExistedDlg
  624.  
  625.        ifint $($ShellCode) != $(!SHELL_CODE_OK)
  626.            Debug-Output "ShellCode error: cannot get an error string."
  627.            goto ShellCodeError
  628.        endif
  629.  
  630.        ifstr(i) $($R1) != "OK"
  631.            goto end
  632.        endif
  633.        set OldVersionExisted = $(TRUE)
  634.     endif
  635.     endif
  636.  
  637.     ;===================================================
  638.     ;  Netcard Detection logic
  639.     ;
  640.     ;   If this is a detected card, query its parameters
  641.     ;   and merge them into the default list.
  642.     ;
  643.     Ifstr(i) $(DetectedCard) != TRUE
  644.     Goto adaptersetup
  645.     Endif
  646.     ;
  647.     ;   Get the detected parameters
  648.     ;
  649. CheckForMCA = +    
  650.     Debug-Output "At CheckForMCA"
  651.     StartWait
  652.     ;
  653.     ;   Check to see if were on a MicroChannel Machine
  654.     ;
  655.     Shell $(UtilityInf), MCAFindBus, $(EE16_1BYTE), $(EE16_2BYTE)
  656.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  657.     Debug-Output "OEMNADIN.INF: Failed Return from MCAFindBus."
  658.     goto CheckForISA
  659.     endif
  660.     ifstr $($R0) != "NO_ERROR"
  661.     Debug-Output "OEMNADIN.INF: Failed Return from MCAFindBus."
  662.     goto CheckForISA
  663.     endif
  664.     ifstr(i) $($R1) == {}
  665.     set Error = $(CANNOT_FIND_ANY_CARD)
  666.     set CommonStatus = USER_CANCEL
  667.     set from = "end"
  668.     goto nonfatal
  669.     endif
  670.     set AdapterList = $($R1)
  671.     goto skipoptions
  672.  
  673. CheckForISA = +
  674.  
  675.     Debug-Output "At CheckForISA"
  676.     Shell $(ParamInf) Param_QueryCard $(!STF_NCDETCARD)
  677.     EndWait
  678.     Ifstr(i) $($R0) != STATUS_SUCCESSFUL
  679.     Goto adaptersetup
  680.     Endif
  681.     ;
  682.     ;   Merge the detected values in.
  683.     ;
  684.     Set DetectedParams = $($R1)
  685.     Debug-Output "OEMNADIN.INF: Calling Param_SetDefaults to merge detected params"
  686.     Shell $(ParamInf) Param_SetDefaults $(DetectedParams)
  687.     ;
  688.     ;  End Netcard Detection logic
  689.     ;===================================================
  690.  
  691.     goto adaptersetup
  692.  
  693. ;-----------------------------------------------
  694. ; Configuration Section
  695. ;-----------------------------------------------
  696. ;
  697. ;   Get the current values of all the parameters
  698. ;
  699. configureadapter = +
  700.     Debug-Output "At configureadapter"
  701.     Ifstr $(KeyProduct) == $(KeyNull)
  702.     OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_RegBase) $(MAXIMUM_ALLOWED) KeyProduct
  703.     Ifstr $(KeyProduct) == $(KeyNull)
  704.         set RegistryErrorIndex = CANNOT_FIND_COMPONENT_SERVICE
  705.         Debug-Output "Cannot find component product key"
  706.         goto fatalregistry
  707.     Endif
  708.     Endif
  709.  
  710.     ;
  711.     ; Get the other parameters;  they're attached to the service parameters key
  712.     ;
  713.     Debug-Output "INF: Shelling to FindService"
  714.     Shell $(UtilityInf) FindService, $(KeyProduct)
  715.     Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  716.     Debug-Output "INF: FindService shell failure"
  717.     Goto ShellCodeError
  718.     Endif
  719.     Ifstr(i) $($R0) != NO_ERROR
  720.     Debug-Output "INF: FindService Shell error: "$($R0)
  721.     Goto fatalregistry
  722.     endif
  723.  
  724.     Set KeyParameters = $($R2)
  725.  
  726.     ;
  727.     ;  We don't need the services key, so close it.
  728.     ;
  729.     CloseRegKey $($R1)
  730.  
  731.     Ifstr $(KeyParameters) == $(KeyNull)
  732.     set RegistryErrorIndex = CANNOT_FIND_COMPONENT_SERVICE
  733.     Debug-Output "Cannot find component service"
  734.     goto fatalregistry
  735.     endif
  736.  
  737.     set OldVersionExisted = $(TRUE)
  738.  
  739.     set ValueName = ""
  740.     set ValueData = ""
  741.     set ValueStr  = ""
  742.     set ValueList = {}
  743.  
  744.     ;
  745.     ; Get the old values
  746.     ;
  747.     EnumRegValue $(KeyParameters) ValueList
  748.  
  749.     ForListDo $(ValueList)
  750.     set ValueItem = $($)
  751.     set ValueName = *($(ValueItem),1)
  752.     set ValueData = *($(ValueItem),4)
  753.     Ifstr(i) $(ValueName) == "InterruptNumber"
  754.         set IRQValue = $(ValueData)
  755.         Debug-Output "OEMNADIN.INF: Registry IRQ: "$(IRQValue)
  756.     else-ifstr(i) $(ValueName) == "IoBaseAddress"
  757.         set IOAddrValue = $(ValueData)
  758.         Debug-Output "OEMNADIN.INF: Registry IOAddr: "$(IOAddrValue)
  759.     else-ifstr(i) $(ValueName) == "IoChannelReady"
  760.         set IOReadyValue = $(ValueData)
  761.         Debug-Output "OEMNADIN.INF: Registry IOChannelReady: "$(IOReadyValue)
  762.     else-ifstr(i) $(ValueName) == "Transceiver"
  763.         set TransceiverValue = $(ValueData)
  764.         Debug-Output "OEMNADIN.INF: Registry Transceiver: "$(TransceiverValue)
  765.     endif
  766.     EndForListDo
  767.  
  768.     ifstr(i) $(IRQValue) == ""
  769.     set IRQValue = *($(IRQList), 1)
  770.         Debug-Output "OEMNADIN.INF: Setting Default IRQ"
  771.     endif
  772.     ifstr(i) $(IOAddrValue) == ""
  773.     set IOAddrValue = *($(IOAddrList), 1)
  774.         Debug-Output "OEMNADIN.INF: Setting Default IOAddress"
  775.     endif
  776.     ifstr(i) $(IOReadyValue) == ""
  777.     set IOReadyValue = *($(IOReadyList), 2)
  778.         Debug-Output "OEMNADIN.INF: Setting Default IOChannelReady"
  779.     endif
  780.     ifstr(i) $(TransceiverValue) == ""
  781.     set TransceiverValue = *($(TransceiverList), 3)
  782.         Debug-Output "OEMNADIN.INF: Setting Default Transceiver"
  783.     endif        
  784.     
  785.     set IOAddrValue = *($(IOAddrList), ~($(IOAddrValues),$(IOAddrValue)))
  786.     set IRQValue = *($(IRQList), ~($(IRQList),$(IRQValue)))
  787.     set IOReadyValue = *($(IOReadyList), $(IOReadyValue))
  788.     set TransceiverValue = *($(TransceiverList), $(TransceiverValue))
  789.  
  790. ;
  791. ;   Put up the adapter configuration dialog if necessary.
  792. ;
  793. adaptersetup = +
  794.  
  795.     Debug-Output "At adaptersetup"
  796.     Shell "" DebugConfiguration "before displaying dialog"
  797.  
  798.     
  799. ;    set IOAddrValue = *($(IOAddrList), ~($(IOAddrValues),$(IOAddrValue)))
  800. ;    set IRQValue = *($(IRQList), ~($(IRQList),$(IRQValue)))
  801. ;    set IOReadyValue = *($(IOReadyList), $(IOReadyValue))
  802. ;    set TransceiverValue = *($(TransceiverList), $(TransceiverValue))
  803. ;
  804.     Shell "" DebugConfiguration "After List Translation"
  805.     
  806.     ;===================================================
  807.     ;  Netcard Detection logic
  808.     ;
  809.     ;   Check that this card's parameters can be
  810.     ;   fully detected.
  811.     ;
  812.     Shell $(ParamInf) Param_ParameterConfidence
  813.     Ifstr(i) $($R0) != STATUS_SUCCESSFUL
  814.     Debug-Output "OEMNADIN.INF: parameter confidence too low to bypass configuration"
  815.     Goto adapteroptions
  816.     Endif
  817.     ;
  818.     ;   If this is a detected card and we're in EXPRESS mode,
  819.     ;   see if the parameters as they currently exist are
  820.     ;   verifiably correct.
  821.     ;
  822.     Ifstr(i) $(DetectedCard) == TRUE
  823.     Ifstr(i) $(!STF_INSTALL_MODE) != CUSTOM
  824.         Goto adapterverify
  825.     Endif
  826.     Endif
  827.     ;
  828.     ;  End Netcard Detection logic
  829.     ;===================================================
  830.  
  831. adapteroptions = +
  832.     Debug-Output "At adapteroptions"
  833.     Set from = adapteroptions
  834.  
  835. ;    set IOBaseAddrValue = *($(IOAddrList), ~($(IOAddrList),$(IOBaseAddrValue)))
  836. ;    set IOReadyValue = *($(IOReadyList), $(IOReady))
  837. ;    set TransceiverValue = *($(TransceiverList), $(Transceiver))
  838.  
  839.     read-syms FileDependentDlg$(!STF_LANGUAGE)
  840.  
  841.     ui start "InputDlg"
  842.  
  843.     ifstr(i) $(DLGEVENT) == "CONTINUE"
  844.       Set IRQValue = $(Combo1Out)
  845.          Set IOAddrValue = $(Combo2Out)
  846.     Set IOReadyValue = ~($(IOReadyList),$(Combo3Out))
  847.     Set TransceiverValue = ~($(TransceiverList),$(Combo4Out))
  848.     ui pop 1
  849.     else-ifstr(i) $(DLGEVENT) == "BACK"
  850.     set CommonStatus = STATUS_USERCANCEL
  851.     Debug-Output "Action: exit. Bye."
  852.     ui pop 1
  853.     goto end
  854.     else
  855.     Debug-Output "Action: unknown. Bye."
  856.     ui pop 1
  857.     goto end
  858.     endif
  859.     
  860. adapterverify = +
  861.  
  862.     Debug-Output "At adapterverify"
  863.     Shell "" DebugConfiguration "after running dialog"
  864.  
  865.     ;===================================================
  866.     ;  Netcard Detection logic
  867.     ;
  868.     ;   If this is a detected card, attempt to validate the options
  869.     ;
  870.     Ifstr(i) $(DetectedCard) != TRUE
  871.     Goto skipoptions
  872.     Endif
  873.  
  874.     Debug-Output "OEMNADIN.INF: Calling Param_VerifyCard"
  875.     Shell $(ParamInf) Param_VerifyCard $(!STF_NCDETCARD)
  876.     Ifstr(i) $($R0) == STATUS_SUCCESSFUL
  877.     Debug-Output "OEMNADIN.INF: Param_VerifyCard succeeded"
  878.     Goto skipoptions
  879.     Endif
  880.     ;
  881.     ;   Give the user a chance to retry or force the options given.
  882.     ;
  883.     Set from = adapteroptions
  884.     Set to = skipoptions
  885.     Shell $(UtilityInf),RegistryErrorString,VERIFY_WARNING
  886.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  887.     Debug-Output "ShellCode error: cannot get an error string."
  888.     goto ShellCodeError
  889.     endif
  890.     set Error = $($R0)
  891.     Goto Warning
  892.     ;
  893.     ;  End Netcard Detection logic
  894.     ;===================================================
  895.  
  896. ;
  897. ;   If installing, go create the necessary keys;
  898. ;   if configuring, they're already open.
  899. ;
  900. skipoptions =+
  901.  
  902.     Debug-Output "At skipoptions"
  903.     ifint $(OldVersionExisted) == $(TRUE)
  904.     ifstr(i) $(!NTN_InstallMode) == configure
  905.         goto writeparameters
  906.     endif
  907.     endif
  908.     StartWait
  909.     ;
  910.     ; Add Software Component
  911.     ;
  912.     ifint $(OldVersionExisted) == $(FALSE)
  913.     ifstr(i) $(!NTN_InstallMode) == "install"
  914.        Ifstr(i) $(DoCopy) == "YES"
  915.  
  916.           Shell $(UtilityInf), DoAskSource, $(!STF_CWDDIR), $(SrcDir) YES
  917.  
  918.           Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  919.           Goto ShellCodeError
  920.           Else-Ifstr(i) $($R0) == STATUS_FAILED
  921.           Shell $(UtilityInf) RegistryErrorString "ASK_SOURCE_FAIL"
  922.           ifint $($ShellCode) != $(!SHELL_CODE_OK)
  923.               goto ShellCodeError
  924.           endif
  925.           set Error = $($R0)
  926.           Goto fatal
  927.           Else-Ifstr(i) $($R0) == STATUS_USERCANCEL
  928.           Goto successful
  929.           Endif
  930.  
  931.           Set SrcDir = $($R1)
  932.  
  933.        Endif
  934.  
  935.        install "Install-Option"
  936.        ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  937.           Shell $(UtilityInf) RegistryErrorString "UNABLE_COPY_FILE"
  938.           ifint $($ShellCode) != $(!SHELL_CODE_OK)
  939.           goto ShellCodeError
  940.           endif
  941.           set Error = $($R0)
  942.           goto fatal
  943.        endif
  944.     endif
  945.  
  946.     Debug-Output "At AddSoftwareComponent"
  947.     Shell $(UtilityInf), AddSoftwareComponent, $(Manufacturer), +
  948.         $(ProductSoftwareName), +
  949.         $(ProductSoftwareName), +
  950.         $(ProductSoftwareTitle), $(STF_CONTEXTINFNAME), +
  951.         $(ProductSoftwareImagePath), "kernel", "NDIS", {}, "",+
  952.         $(NetEventDLL)
  953.  
  954.     Set OEM_ABANDON_SOFTWARE = TRUE
  955.  
  956.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  957.         Debug-Output "ShellCode error"
  958.         goto ShellCodeError
  959.     endif
  960.     ;
  961.     ;   At this point:
  962.     ;     $R1 contains the product version key handle;
  963.     ;     $R2 contains the NetRules subkey handle;
  964.     ;     $R3 contains the new Services key handle; and
  965.     ;     $R4 contains the Parameters key
  966.     ;     $R5 contains the Linkage Key
  967.     ;
  968.     set RegistryErrorIndex = $($R0)
  969.     set KeyProduct      = $($R1)
  970.     Set SoftNetRulesKey = $($R2)
  971.     CloseRegKey $($R3)
  972.     CloseRegKey $($R4)
  973.     CloseRegKey $($R5)
  974.  
  975.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  976.         EndWait
  977.         Debug-Output "Registry error: add software components"
  978.         CloseRegKey $(KeyProduct)
  979.         CloseRegKey $(SoftNetRulesKey)
  980.         goto fatalregistry
  981.     endif
  982.  
  983.     set NewValueList = {{SoftwareType,$(NoTitle),$(!REG_VT_SZ),$(SoftwareType)},+
  984.                {MajorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMajorVersion)},+
  985.                {MinorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMinorVersion)},+
  986.                {Title,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareTitle)},+
  987.                {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareDescription)},+
  988.                {ServiceName,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareName)},+
  989.                {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
  990.  
  991.     Debug-Output "At AddValueList - SoftwareType"
  992.     Shell  $(UtilityInf), AddValueList, $(KeyProduct), $(NewValueList)
  993.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  994.         Debug-Output "ShellCode error."
  995.         goto ShellCodeError
  996.     endif
  997.  
  998.     set RegistryErrorIndex = $($R0)
  999.  
  1000.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  1001.         EndWait
  1002.         Debug-Output "Registry error: add value list."
  1003.         CloseRegKey $(KeyProduct)
  1004.         CloseRegKey $(SoftNetRulesKey)
  1005.         goto fatalregistry
  1006.     endif
  1007.  
  1008.     set NewValueList = {{type,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareType)},+
  1009.                 {use,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareUse)}, +
  1010.                 {bindform,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareBindForm)}, +
  1011.                 {class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleSoftwareClass)}, +
  1012.                 {bindable,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleSoftwareBindable)}, +
  1013.                 {InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}}
  1014.  
  1015.     Debug-Output "At AddValueList - bindform"
  1016.     Shell  $(UtilityInf), AddValueList, $(SoftNetRulesKey), $(NewValueList)
  1017.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1018.         Debug-Output "ShellCode error."
  1019.         goto ShellCodeError
  1020.     endif
  1021.  
  1022.     set RegistryErrorIndex = $($R0)
  1023.  
  1024.     CloseRegKey $(KeyProduct)
  1025.     CloseRegKey $(SoftNetRulesKey)
  1026.  
  1027.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  1028.         EndWait
  1029.         Debug-Output "Resgitry error: add value list."
  1030.         goto fatalregistry
  1031.     endif
  1032.     endif
  1033. ;
  1034. ;   Create the HARDWARE\Netcard region and its corresponding service
  1035. ;
  1036.     Debug-Output "At AddHardwareComponent"
  1037.     Shell $(UtilityInf), AddHardwareComponent, $(ProductHardwareName),$(STF_CONTEXTINFNAME),$(ProductKeyName)
  1038.  
  1039.     ifint $($R4) != -1
  1040.     Set OEM_ABANDON_OPTIONS = >($(OEM_ABANDON_OPTIONS), $(!NTN_SoftwareBase)"\Microsoft\Windows NT\CurrentVersion\NetworkCards\"$($R4))
  1041.     endif
  1042.  
  1043.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1044.     Debug-Output "Cannot add hardware component"
  1045.     goto ShellCodeError
  1046.     endif
  1047.  
  1048.     set RegistryErrorIndex = $($R0)
  1049.  
  1050.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  1051.     EndWait
  1052.     Debug-Output "Registry error: add hardware component"
  1053.     CloseRegKey $($R1)
  1054.     CloseRegKey $($R2)
  1055.     CloseRegKey $($R3)
  1056.     goto fatalregistry
  1057.     endif
  1058.  
  1059. ;
  1060. ;   At this point:
  1061. ;     $R1  Registry key variable for HARDWARE\Netcard\(n)
  1062. ;     $R2  Registry key variable for HARDWARE\Netcard\(n)\\NetRules
  1063. ;     $R3  Registry key handle for <service>\Parameters key
  1064. ;     $R4  Adapter number assigned to adapter
  1065. ;     $R5  Service name generated by combining svc name with adapter number
  1066. ;
  1067.     set KeyParameters = $($R3)
  1068.     set KeyAdapterRules = $($R2)
  1069.     set AdapterNumber = $($R4)
  1070.  
  1071.     set NewValueList = {{Manufacturer,$(NoTitle),$(!REG_VT_SZ),$(Manufacturer)},+
  1072.                {Title,$(NoTitle),$(!REG_VT_SZ),"["$($R4)"] "$(ProductHardwareTitle)},+
  1073.                {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductHardwareDescription)},+
  1074.                {ProductName,$(NoTitle),$(!REG_VT_SZ),$(ProductHardwareName)},+
  1075.                {ServiceName,$(NoTitle),$(!REG_VT_SZ),$($R5)},+
  1076.                {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
  1077.  
  1078.     Debug-Output "At AddValueList - Manufacturer"
  1079.     Shell  $(UtilityInf), AddValueList, $($R1), $(NewValueList)
  1080.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1081.     Debug-Output "ShellCode error"
  1082.     goto ShellCodeError
  1083.     endif
  1084.  
  1085.     CloseRegKey $($R1)
  1086.  
  1087.     set TempProdName = """"$(ProductHardwareName)$(AdapterNumber)""""
  1088.     set TempBindForm = $(TempProdName)$(NetRuleHardwareBindForm)
  1089.  
  1090.     set NewValueList = {{type,$(NoTitle),$(!REG_VT_SZ),$(NetRuleHardwareType)},+
  1091.             {bindform,$(NoTitle),$(!REG_VT_SZ),$(TempBindForm)}, +
  1092.             {class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleHardwareClass)}, +
  1093.             {InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}}
  1094.  
  1095.     Debug-Output "At AddValueList - class"
  1096.     Shell  $(UtilityInf), AddValueList, $(KeyAdapterRules), $(NewValueList)
  1097.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1098.     Debug-Output "ShellCode error."
  1099.     goto ShellCodeError
  1100.     endif
  1101.  
  1102.     set RegistryErrorIndex = $($R0)
  1103.  
  1104.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  1105.     EndWait
  1106.     Debug-Output "Resgitry error: add value list."
  1107.     CloseRegKey $(KeyParameters)
  1108.     CloseRegKey $(KeyAdapterRules)
  1109.     goto fatalregistry
  1110.     endif
  1111.  
  1112.     CloseRegKey $(KeyAdapterRules)
  1113.  
  1114.     goto writeparameters
  1115. ;
  1116. ;   REQUIRED:   $(KeyParameters) contains service Parameters key handle
  1117. ;
  1118. writeparameters = +
  1119.     Debug-Output "At writeparameters"
  1120.     Shell $(UtilityInf), GetBusTypeNum
  1121.     set BusTypeNum = $($R1)
  1122.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1123.     Debug-Output "ShellCode error."
  1124.     goto ShellCodeError
  1125.     endif
  1126. ;
  1127. ;   Add the rest of the parameters to the Services area
  1128. ;
  1129.     Ifstr(i) $(MachineType) == "MCA"
  1130.        set NewValueList = {{BusType,$(NoTitle),$(!REG_VT_DWORD),$(BusTypeNum)},+
  1131.               {McaPosId,$(NoTitle),$(!REG_VT_DWORD),$(NETCARD_ID)},+
  1132.               {SlotNumber,$(NoTitle),$(!REG_VT_DWORD),$(SlotNum)},+
  1133.               {MediaType,$(NoTitle),$(!REG_VT_DWORD),1}}
  1134.     else                       
  1135.        Set IOAddrValue = *($(IOAddrValues), ~($(IOAddrList),$(IOAddrValue)))
  1136.        Shell "" DebugConfiguration "Before Writing Parameters"
  1137.        set NewValueList = {{InterruptNumber,$(NoTitle),$(!REG_VT_DWORD),$(IRQValue)},+
  1138.               {BusType,$(NoTitle),$(!REG_VT_DWORD),$(BusTypeNum)},+
  1139.               {MediaType,$(NoTitle),$(!REG_VT_DWORD),1},+
  1140.               {IoChannelReady,$(NoTitle),$(!REG_VT_DWORD),$(IOReadyValue)},+
  1141.               {Transceiver,$(NoTitle),$(!REG_VT_DWORD),$(TransceiverValue)},+
  1142.               {IoBaseAddress,$(NoTitle),$(!REG_VT_DWORD),$(IOAddrValue)}}
  1143.     endif
  1144.     
  1145.     Shell  $(UtilityInf), AddValueList, $(KeyParameters), $(NewValueList)
  1146.  
  1147.     CloseRegKey $(KeyParameters)
  1148.  
  1149.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1150.     Debug-Output "ShellCode error."
  1151.     goto ShellCodeError
  1152.     endif
  1153.  
  1154.     set RegistryErrorIndex = $($R0)
  1155.  
  1156.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  1157.     Debug-Output "Registry error: Add value list"
  1158.     goto fatalregistry
  1159.     endif
  1160.  
  1161.     EndWait
  1162.  
  1163.     goto successful
  1164.  
  1165. ;-----------------------------------------------
  1166. ; Binding section
  1167. ;-----------------------------------------------
  1168. bindingadapter =+
  1169.     Debug-Output "At bindingadapter"
  1170.     set Error = "Binding: Sorry, not yet implemented."
  1171.     goto fatal
  1172.  
  1173. ;-----------------------------------------------
  1174. ; Removeadapter section
  1175. ;-----------------------------------------------
  1176.  
  1177. removeadapter = +
  1178.     Debug-Output "At removeadapter"
  1179.     Ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
  1180.     ; Remove Software Component
  1181.     Shell $(UtilityInf), RemoveSoftwareComponent, $(Manufacturer), +
  1182.         $(ProductSoftwareName)
  1183.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1184.         Debug-Output "ShellCode error"
  1185.         goto ShellCodeError
  1186.     endif
  1187.  
  1188.     set RegistryErrorIndex = $($R0)
  1189.  
  1190.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  1191.         goto fatalregistry
  1192.     endif
  1193.     else
  1194.     Shell $(UtilityInf), RemoveHardwareComponent, $(Manufacturer), +
  1195.         $(ProductSoftwareName), $(!NTN_RegBase)
  1196.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1197.         Debug-Output "ShellCode error"
  1198.         goto ShellCodeError
  1199.     endif
  1200.  
  1201.     set RegistryErrorIndex = $($R0)
  1202.  
  1203.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  1204.         goto fatalregistry
  1205.     endif
  1206.     endif
  1207.  
  1208.     goto end
  1209.  
  1210. ;-----------------------------------------------
  1211. ; Upgrade Software section
  1212. ;-----------------------------------------------
  1213.  
  1214. UpgradeSoftware = +
  1215.     Debug-Output "At UpgradeSoftware"
  1216.     ;
  1217.     ; First determine whether we want to do upgrade or update for software
  1218.     ; or hardware component. Then we will determine whether the Mode is
  1219.     ; update or upgrade.
  1220.     ;
  1221.     ; If the same version of the product existed in the registry, we do
  1222.     ; update. Otherwise, we will do a upgrade
  1223.     ;
  1224.     ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
  1225.     ; Upgrade software component
  1226.     ;
  1227.     ; see whether the same version exist or not
  1228.     ;
  1229.     OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
  1230.  
  1231.     Ifstr $(KeyProduct) != $(KeyNull)
  1232.         GetRegValue $(KeyProduct),"MajorVersion", VersionInfo
  1233.         set Version = *($(VersionInfo), 4)
  1234.  
  1235.         ;
  1236.         ; Update the binaries
  1237.         ;
  1238.         Split-String $(!NTN_Infname), "\", FilenameList
  1239.         QueryListSize ListSize $(FilenameList)
  1240.         set !UG_Filename = *($(FilenameList), $(ListSize))
  1241.  
  1242.         install "Install-Update"
  1243.         ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  1244.         goto fatal
  1245.         endif
  1246.  
  1247.         ; Upgrade the version number
  1248.         ;
  1249.         SetRegValue $(KeyProduct) {MajorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMajorVersion)}
  1250.         SetRegValue $(KeyProduct) {MinorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMinorVersion)}
  1251.  
  1252.         ;
  1253.         ; do nothing for update
  1254.         ;
  1255.         ifint $(Version) != $(ProductVersion)
  1256.            ;
  1257.            ; If the major version number is not the same,
  1258.            ; it is major upgrade. So let Upgrade the product
  1259.            ;
  1260.            ;
  1261.            ; make other upgrade change if necessary
  1262.            ;
  1263.         endif
  1264.         CloseRegKey $(KeyProduct)
  1265.     else
  1266.         ;
  1267.         ; Cannot Open software key, goto ERROR
  1268.         ;
  1269.         goto fatalregistry
  1270.     endif
  1271.     else
  1272.     ;
  1273.     ; upgrade/update hardware component
  1274.     ; There is no different between upgrade and update for hardware
  1275.     ; component
  1276.     ;
  1277.     ; 1. Get the Service Name
  1278.     ; 2. Change the NetRule section if necessary
  1279.     ;
  1280.     OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_RegBase) +
  1281.           $(MAXIMUM_ALLOWED) NetworkCardKey
  1282.     Ifstr(i) $(NetworkCardKey) != $(KeyNull)
  1283.         ;
  1284.         ; Get Service name
  1285.         ;
  1286.         GetRegValue $(NetworkCardKey),"ServiceName", ServiceNameInfo
  1287.         set ServiceName = *($(ServiceNameInfo), 4)
  1288.  
  1289.         ;
  1290.         ; Change the NetRule if necessary
  1291.         ;
  1292.         OpenRegKey $(NetworkCardKey) "" "NetRules" +
  1293.         $(MAXIMUM_ALLOWED) NetRuleKey
  1294.         Ifstr(i) $(NetRuleKey) != $(KeyNull)
  1295.         ;
  1296.         ; Make the change....
  1297.         ;
  1298.         else
  1299.         ;
  1300.         ; Error, cannot open net rules key
  1301.         ;
  1302.         goto fatalregistry
  1303.         endif
  1304.  
  1305.         CloseRegKey $(NetRules)
  1306.         CloseRegKey $(NetworkCardKey)
  1307.     else
  1308.         ;
  1309.         ; Error, cannot open network card key
  1310.         ;
  1311.         goto fatalregistry
  1312.     endif
  1313.     ;
  1314.     ; 3. Change the service section of the hardware. i.e.,
  1315.     ;    ParameterName change, value change, etc.
  1316.     ;
  1317.     OpenRegKey $(!REG_H_LOCAL) "" +
  1318.           $(!NTN_ServiceBase)"\"$(ServiceName) +
  1319.           $(MAXIMUM_ALLOWED) ServiceKey
  1320.  
  1321.     Ifstr(i) $(ServiceKey) != $(KeyNull)
  1322.         ;
  1323.         ; Get the ServiceKey to change the Start value
  1324.         ; or Type value. Or open Parameters key to
  1325.         ; change the hardware parameters if necessary.
  1326.         ;
  1327.         CloseRegKey $(ServiceKey)
  1328.     else
  1329.         ;
  1330.         ; Error, cannot open network card key
  1331.         ;
  1332.         goto fatalregistry
  1333.     endif
  1334.     endif
  1335.  
  1336.     goto end
  1337.     ;
  1338.     ; End of Upgrade Software
  1339.     ;
  1340.  
  1341. ;
  1342. ;  Escape hatches
  1343. ;
  1344. successful = +
  1345.     Debug-Output "At successful"
  1346.     goto end
  1347.  
  1348. abandon = +
  1349.     Debug-Output "At abandon"
  1350.     ForListDo $(OEM_ABANDON_OPTIONS)
  1351.     Shell $(UtilityInf), RemoveHardwareComponent, $(Manufacturer), +
  1352.         $(ProductSoftwareName), $($)
  1353.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1354.         Debug-Output "ShellCode error"
  1355.         goto ShellCodeError
  1356.     endif
  1357.  
  1358.     set RegistryErrorIndex = $($R0)
  1359.  
  1360.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  1361.         goto fatalregistry
  1362.     endif
  1363.     EndForListDo
  1364.  
  1365.     Ifstr(i) $(OEM_ABANDON_SOFTWARE) == TRUE
  1366.     ; Remove Software Component
  1367.     Shell $(UtilityInf), RemoveSoftwareComponent, $(Manufacturer), +
  1368.         $(ProductSoftwareName), FALSE
  1369.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1370.         Debug-Output "ShellCode error"
  1371.         goto ShellCodeError
  1372.     endif
  1373.  
  1374.     set RegistryErrorIndex = $($R0)
  1375.  
  1376.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  1377.         goto fatalregistry
  1378.     endif
  1379.     endif
  1380.  
  1381.     goto end
  1382.  
  1383. ;
  1384. ; warning display
  1385. ;
  1386. warning = +
  1387.     Debug-Output "At warning"
  1388.     Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "WARNING", $(Error)
  1389.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1390.     goto ShellCodeError
  1391.     endif
  1392.     ifstr(i) $($R1) == "OK"
  1393.     goto $(to)
  1394.     else-ifstr(i) $($R1) == "CANCEL"
  1395.     goto $(from)
  1396.     else
  1397.     goto "end"
  1398.     endif
  1399. ;
  1400. ; non fatal error display
  1401. ;
  1402. nonfatalinfo = +
  1403.     Debug-Output "At nonfatalinfo"
  1404.     Set Severity = STATUS
  1405.     Set CommonStatus = STATUS_USERCANCEL
  1406.     goto nonfatalmsg
  1407. nonfatal = +
  1408.     Debug-Output "At nonfatal"
  1409.     Set Severity = NONFATAL
  1410.     goto nonfatalmsg
  1411. nonfatalmsg = +
  1412.     Debug-Output "At nonfatalmsg"
  1413.     ifstr(i) $(Error) == ""
  1414.     Set Severity = NONFATAL
  1415.     Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  1416.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1417.         goto ShellCodeError
  1418.     endif
  1419.     set Error = $($R0)
  1420.     endif
  1421.     Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), $(Severity), $(Error)
  1422.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1423.     goto ShellCodeError
  1424.     endif
  1425.     ifstr(i) $($R1) == "OK"
  1426.     goto $(from)
  1427.     else
  1428.     goto "end"
  1429.     endif
  1430.  
  1431. ;
  1432. ;  Registry is broken
  1433. ;
  1434. fatalregistry = +
  1435.     Debug-Output "At fatalregistry"
  1436.     Shell $(UtilityInf) RegistryErrorString $(RegistryErrorIndex)
  1437.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1438.     goto ShellCodeError
  1439.     endif
  1440.     set Error = $($R0)
  1441.     goto fatal
  1442. ;
  1443. ;  Netcard detection failure
  1444. ;
  1445. fataldetect = +
  1446.     Debug-Output "At fataldetect"
  1447.     Shell $(UtilityInf),RegistryErrorString,CANNOT_DETECT
  1448.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1449.     Debug-Output "ShellCode error: cannot get an error string."
  1450.     goto ShellCodeError
  1451.     endif
  1452.     set Error = $($R0)
  1453.     Goto fatal
  1454. ;
  1455. ; fatal error display
  1456. ;
  1457. fatal = +
  1458.     Debug-Output "At fatal"
  1459.     ifstr(i) $(Error) == ""
  1460.     Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  1461.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1462.         goto ShellCodeError
  1463.     endif
  1464.     set Error = $($R0)
  1465.     endif
  1466.     Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "FATAL", $(Error)
  1467.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1468.     goto ShellCodeError
  1469.     endif
  1470.  
  1471.     goto setfailed
  1472.  
  1473. ;
  1474. ;  Shelling error
  1475. ;
  1476. ShellCodeError = +
  1477.     Debug-Output "At ShellCodeError"
  1478.     set DlgType      = "MessageBox"
  1479.     set STF_MB_TITLE = "Error: "$(FunctionTitle)
  1480.     set STF_MB_TEXT  = "Shell Code Error"
  1481.     set STF_MB_TYPE  = 1
  1482.     set STF_MB_ICON  = 3
  1483.     set STF_MB_DEF   = 1
  1484.     ui start "Error Message"
  1485.     goto setfailed
  1486.  
  1487. setfailed = +
  1488.     Debug-Output "At setfailed"
  1489.     set CommonStatus = STATUS_FAILED
  1490.     ;
  1491.     ; if OEM_ABANDON_ON == TRUE, then remove the registry entries
  1492.     ;
  1493.     ifstr(i) $(OEM_ABANDON_ON) == TRUE
  1494.     set OEM_ABANDON_ON = FALSE
  1495.     goto abandon
  1496.     endif
  1497.     goto end
  1498.  
  1499. end = +
  1500.     Debug-Output "At end"
  1501.     goto term
  1502.  
  1503. term = +
  1504.     Debug-Output "At term"
  1505.     Return $(CommonStatus)
  1506.  
  1507.  
  1508. [DebugConfiguration]
  1509.  
  1510.     Set InfName = "OEMNADIN.INF"
  1511.     Debug-Output $(InfName)" **CONFIGURATION STATE: "$($0)
  1512.     Debug-Output $(InfName)" IRQValue is "$(!p:IRQValue)
  1513.     Debug-Output $(InfName)" IOAddrValue is "$(!p:IOAddrValue)
  1514.     Debug-Output $(InfName)" IOReadyValue is "$(!p:IOReadyValue)
  1515.     Debug-Output $(InfName)" TransceiverValue is "$(!p:TransceiverValue)
  1516.  
  1517.     return
  1518.  
  1519.  
  1520. ;***************************************************************
  1521. ;  INSTALL SECTIONS
  1522. ;***************************************************************
  1523. [Install-Option]
  1524.     Debug-Output "At Install-Option"
  1525.     set STF_VITAL = ""
  1526.  
  1527.     ifstr(i) $(AddCopy) == "YES"
  1528.  
  1529.     ;
  1530.     ; Add the files to the copy list
  1531.     ;
  1532.     ;  BUGBUG: eliminate the "nt2" in the next line when Sunil fixes
  1533.     ;      the other INF files
  1534.     ;
  1535.     AddSectionFilesToCopyList Files-$(Option) $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers
  1536.  
  1537.     endif
  1538.  
  1539.     ifstr(i) $(DoCopy) == "YES"
  1540.  
  1541.        ;
  1542.        ; Copy files in the copy list
  1543.        ;
  1544.        set !STF_NCPA_FLUSH_COPYLIST = TRUE
  1545.        CopyFilesInCopyList
  1546.  
  1547.     endif
  1548.  
  1549.     Exit
  1550.  
  1551. [Install-Update]
  1552.     Debug-Output "At Install-Update"
  1553.    set STF_VITAL        = ""
  1554.    set STF_OVERWRITE    = "VERIFYSOURCEOLDER"
  1555.    ;set STF_VERSION     = "YES"
  1556.  
  1557.    AddSectionFilesToCopyList Files-$(Option) $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers
  1558.    AddSectionFilesToCopyList Files-Inf $(SrcDir) $(!STF_WINDOWSSYSPATH)
  1559.  
  1560.    set !STF_NCPA_FLUSH_COPYLIST = TRUE
  1561.    CopyFilesInCopyList
  1562.  
  1563.    exit
  1564.  
  1565.